<div class="container d-gao-80 d-yincang">
</div>

<div class="container">
	<div class="row">
		<div class="col-md-8">
			<div class="d-yuanjiao-20 d-kuan">
				{if $danquanhaibao == 1}
				{else}
				<!--首页海报-->
				{template "index-haibao.html"}
				<div class="d-danquan-xia-20"></div>
				{/if}
				{if $danquanfabu == 1}
				{else}
				<!--快速发布-->
				{template "index-post.html"}
				{/if}
			</div>
			<div class="d-kuan d-buhuanhang d-beijing-baise d-bianhua-10 d-yuanjiao-10 d-waigao-20 d-wenzi-14 d-wenzi-juzhong">
				{category module=tubiao show=1 id=1 pid=0}
					{php $i=1;}
					{module module=tubiao order=displayorder catid=$t.id page=1 pagesize=$t.xingshu return=tt}
					<div class="d-kuan-25 d-quxian-0">
						<a href="{$tt.tzwz}" {if $tt.tiaozhuan ==1}target="_blank"{/if}>
							{if $tt.thumb}<img src="{dr_thumb($tt.thumb)}" width="40" class="d-yuanjiao-10 d-img"/>{/if}
							<div>
								{$tt.title}
							</div>
						</a>
					</div>
					{if $i < 4}<div class="d-shuxian-1 d-yincang"></div>{/if}
					{php $i++;}
					{/module}
				{/category}
			</div>
			{if dr_is_app('qiandao')}
			<div class="d-yuanjiao-20 d-kuan">
				<!--签到-->
				{if dr_is_app('qiandao')}
					{php $qiandaoconfig = \Phpcmf\Service::L('cache')->get_file('app-qiandao');}
					{if $qiandaoconfig['xianshi'] == '1' || $qiandaoconfig['xianshi'] == '0' }
					{template "index-qiandao.html"}
					{/if}
				{/if}
			</div>
			{/if}
			{template "index-shenhe.html"}
			{template "index-tuijian.html"}
			<div id="content_list">
			    {template "index-list-data.html"}
			</div>
			<div class="d-kuan d-gao-80"></div>
		</div>
		<div class="col-md-4 d-yincang d-huading-300">
			<div class="d-yuanjiao-10 d-buhuanhang d-kuan d-beijing-baise d-bianhua-15-20 d-wenzi-juzhong">
				<div class="d-kuan-33">
					<div class="d-wenzi-16">
						{count action=table table=1_quan_form_son_comment return=quans}
						{$quans_count}
					</div>
					<div class="d-shangxia-10">评论</div>
					<img class="" src="{HOME_THEME_PATH}quan/img/quan.png" height="26">
				</div>
				<div class="d-shuxian-1-30"></div>
				<div class="d-kuan-33">
					<div class="d-wenzi-16">
						{count action=table table=1_quan_form_son return=quanties}
						{$quanties_count}
					</div>
					<div class="d-shangxia-10">帖子</div>
					<img class="" src="{HOME_THEME_PATH}quan/img/tiezi.png" height="26">
				</div>
				<div class="d-shuxian-1-30"></div>
				<div class="d-kuan-33">
					<div class="d-wenzi-16">
						{count action=table table=member return=members}
						{$members_count}
					</div>
					<div class="d-shangxia-10">会员</div>
					<img class="" src="{HOME_THEME_PATH}quan/img/wo.png" height="26">
				</div>
				
			</div>
			
			<div class="d-yuanjiao-10 d-kuan d-beijing-baise d-bianhua-10 d-shang-20">
				<!--div class="d-kuan  d-hanggao-50 d-yuanjiao-10 d-wenzi-juzhong d-quxian-0 d-xia-15 d-zitiyanse-bai" style="background-color: #448eff;">
					<a href="{SITE_URL}/index.php?s=member&app=shequ&c=home&m=add&kuai=1" class="d-jiacu d-wenzi-16"> 发 布 </a>
				</div-->
				<!--div class="d-yuanjiao-20 d-kuan d-jiacu d-wenzi-16">
					社区分类
				</div-->
				<div class="d-kuan">
					<div class="d-kuan d-quxian d-jiacu ">
						<a href="{dr_url('quan/show/index', ['id'=>$danquanid])}" class="d-kuan  d-kuai d-hanggao-40 d-wenzi-16 ">
							<span class="d-zuo-10">全部</span>
						</a>
					</div>
					{php $erjibiao = '1_quan_fenlei';}
					{table table=$erjibiao yijiid=0 cid=$danquanid order=paixu_asc num=100 return=t1}
					{php $youerji = \Phpcmf\Service::M()->db->table($erjibiao)->where('yijiid', $t1.id)->get()->getRowArray();}
						<div class="d-kuan d-quxian d-jiacu d-xia-10 {if $_GET['qid'] == $t1.id} d-beijing-hei-f0 d-yuanjiao-10{/if}">
							<a href="{dr_url('quan/show/index', ['id'=>$danquanid,'qid'=>$t1.id])}" class="d-kuan  d-kuai d-hanggao-40 d-wenzi-16 {if $_GET['qid'] == $t1.id } d-jiacu{/if}">
								<span class="d-zuo-10">{$t1.name}</span>
							</a>
							
							{if $youerji}
							<!--div>
								{table table=$erjibiao yijiid=1 yijiid=$t1.id cid=$index.id order=inputtime_desc num=100 return=t2}
									<a href="{dr_url('quan/show/index', ['id'=>$danquanid,'qid'=>$t1['id'],'erji'=>$t2['id']])}" class="d-hanggao-40  d-kuai {if $_GET['erji'] == $t2.id } d-gaoliang {/if}">
										<span class="d-zuo-20">{$t2.name}</span>
									</a>
								{/table}
							</div-->
							{/if}
						</div>
						
					{/table}
					{if $uid == $member.uid}
					<div class="d-kuan d-quxian d-jiacu d-xia-10 d-beijing-hei-f0 d-yuanjiao-10">
						
							<a href="{dr_member_url('quan/son/index', ['cid'=>$id])}" class="d-kuan  d-kuai d-hanggao-40 d-wenzi-16" >
								<i class="fa fa-cog d-zuo-10"></i> 添加导航
							</a>
						
					</div>
					{/if}
				</div>
			</div>
			
				
			<div class="d-yuanjiao-10 d-kuan d-beijing-baise d-bianhua-20 d-waigao-20">
				<div class="d-kuan d-buhuanhang">
					<div class="d-yuanjiao-20 d-kuan d-jiacu d-wenzi-16">
						推荐圈子
					</div>
					
				</div>
				<div class="d-kuan">
					<div class="row">
						{module module=quan flag=1}
						    <div class="col-md-3 col-xs-3 d-waigao-20 d-quxian">
								<a href="{$t.url}">
									<div class="d-wenzi-juzhong d-yuanjiao-10">
										<img class="d-yuanjiao-20" src="{dr_thumb($t.thumb)}" height="50" width="50"/>
										<div class="d-wenzi-juzhong d-wenzi-12 d-waigao-10">{dr_strcut($t['title'], 8, '')}</div>
									</div>
								</a>
						    </div>
						{/module}
						
					</div>
				</div>
			</div>
			<!--版权-->
			{template "index-banquan.html"}

		</div>
	</div>
</div>
<style>

</style>
<script src="{THEME_PATH}assets/global/plugins/js.cookie.min.js" type="text/javascript"></script>
<script type="text/javascript">
	//滚动显示更多
	var Mpage=1;
	var scroll_get = true;  //做个标志,不要反反复复的加载
	$(document).ready(function () {
	    $(window).scroll(function () {
	        if (scroll_get==true &&  (400 + $(window).scrollTop())>($(document).height() - $(window).height())) {
	            scroll_get = false;
	            /*layer.msg('内容加截中,请稍候',{time:1000});*/
	            dr_ajax_load_more();
	        }
	    });
	});
	function dr_ajax_load_more(){
	    Mpage++;
	    $.get('{SITE_URL}index.php?s=api&c=api&m=template&name=index-list-data.html&format=json&page='+Mpage+'&'+Math.random(),function(res){
	        $('.footer-cont').hide();
	        if(res.code==1){
	            if (res.msg.indexOf("</div>") != -1) {
	                $('#content_list').append(res.msg);
	                scroll_get = true;
	            } else {
	                layer.msg("已经显示完了",{time:500});
	            }
	        }else{
	            /*layer.msg(res.msg,{time:2500});*/
	        }
	    }, 'json');
	}
	// 模块点赞
	$(".tag_zan_list").click(function(){
	    var id = $(this).data("id");
	    $.get("{dr_url_prefix('index.php')}?s=quan&c=son&m=zanlian&id="+id, function(data){
	        dr_cmf_tips(data.code, data.msg.value + data.msg.jifen);
	        if (data.msg.value=="点赞成功") {
				$('#zanlist_list_'+id).load(location.href+" #zanlist_list_"+id+">*","");
				$('#module_zan_list_'+id).html(data.data);
	        	 $('#tag_zan_list_'+id).html('<img src="{HOME_THEME_PATH}quan/img/zan3.svg" width="24" height="24" class="d-yuanjiao-50 d-div-zuo"/>'
	        	);
	        }else{
				$('#zanlist_list_'+id).load(location.href+" #zanlist_list_"+id+">*","");
				$('#module_zan_list_'+id).html(data.data);
	        	$('#tag_zan_list_'+id).html('<img src="{HOME_THEME_PATH}quan/img/zan.svg" width="24" height="24" class="d-yuanjiao-50 d-div-zuo"/>');

	        }
	    }, 'json');
	});
	
	//关注
	$(".guanzhu_list").click(function(){
	    var id = $(this).data("id");
	    $.get("{dr_url_prefix('index.php')}?s=huiyuan&c=show&m=friend&uid="+id, function(data){
	        dr_cmf_tips(data.code, data.msg);
	        if (data.data.status==1) {
				window.location.reload();
				$('#module_guanzhu_list_'+id).html(data.data);
	        	$('#guanzhu_list_'+id).html('<div class=" d-beijing-hui d-yuanjiao-20 d-neikuang-5-10 d-div-you d-wenzi-12"><i class="fa fa-check-circle-o"></i> 已关注</div>');
				
	        }else{
				window.location.reload();
				$('#module_guanzhu_list_'+id).html(data.data);
	        	$('#guanzhu_list_'+id).html('<div class=" d-beijing-hui d-yuanjiao-20 d-neikuang-5-10 d-div-you d-wenzi-12">关 注</div>');
	            
	        }
	    }, 'json');
	});
	function dr_hy_addfriend(uid) {
		$.get("/index.php?is_ajax=1&s=huiyuan&c=show&m=friend&uid="+uid, function(json){
			dr_cmf_tips(json.code, json.msg);
			if (json.code) {
				if (json.data.status) {
					$('#hy_addfriend_'+uid).html(json.data.value);
					$('#hy_addfriend_'+uid).addClass("btn-outline");
					//window.location.href="{$url}";
					window.location.reload();
				} else {
					$('#hy_addfriend_'+uid).html("关注Ta");
					$('#hy_addfriend_'+uid).removeClass("btn-outline");
					//window.location.href="{$url}";
					window.location.reload();
				}
			}
		}, 'json');
	}
	// 点赞圈子
	$(".tag_zan_xiazai").click(function(){
		var id = $(this).data("id");
		$.get("{dr_url_prefix('index.php')}?s=quan&c=son&m=zan&id="+id, function(data){
		 dr_cmf_tips(data.code, data.msg.value + data.msg.jifen);
		 if (data.msg.value=="点赞成功") {
			window.location.reload();
		}else{
			window.location.reload();
		}
		}, 'json');
	});
	// 下载免费附件计算
	$(".tag_xiazaicishu").click(function(){
	    var id = $(this).data("id");
		var uid = $(this).data("uid");
		var file = $(this).data("file");
	    $.get("{dr_url_prefix('index.php')}?s=quan&c=son&m=xiazaicishu&id="+id+"&uid="+uid+"&file="+file, function(data){
	        dr_cmf_tips(data.code, data.msg.value);
	        if (data.code===1) {
				window.location.href = data.msg.jifen;
	        } else {
	
			}
	    }, 'json');
	});
</script>
<style>
	.form-control {
	    width: 100%;
	    height: 34px;
	    padding: 6px 12px;
	    background-color: #f3f4f7;
	    border: 1px solid #f3f4f7;
	    -webkit-box-shadow: inset 0 1px 1px rgb(0 0 0 / 8%);
	    -webkit-transition: border-color ease-in-out .15s,box-shadow ease-in-out .15s;
	    -o-transition: border-color ease-in-out .15s,box-shadow ease-in-out .15s;
	    transition: border-color ease-in-out .15s,box-shadow ease-in-out .15s;
	}
	.form-control:hover {
	    width: 100%;
	    height: 34px;
	    padding: 6px 12px;
	    background-color: #f3f4f7;
	    border: 1px solid #f3f4f7;
	    -webkit-box-shadow: inset 0 1px 1px rgb(0 0 0 / 8%);
	    -webkit-transition: border-color ease-in-out .15s,box-shadow ease-in-out .15s;
	    -o-transition: border-color ease-in-out .15s,box-shadow ease-in-out .15s;
	    transition: border-color ease-in-out .15s,box-shadow ease-in-out .15s;
	}
	.btn-default {
	    color: #333;
	    background-color: #f3f4f7;
	    border-color: #f3f4f7;
	}
	.btn-default:hover {
	    color: #333;
	    background-color: #f3f4f7;
	    border-color: #f3f4f7;
	}
	.input-group input:focus{
		border: 1px solid #f3f4f7;
	}
	.btn-group-vertical>.btn-group:not(:first-child):not(:last-child)>.btn, .input-group .form-control:not(:first-child):not(:last-child), .input-group-addon:not(:first-child):not(:last-child), .input-group-btn:not(:first-child):not(:last-child) {
	    border-radius: 5px 0 0 5px;
	}
	.d-danquan-xia-20 {
		margin-bottom: 20px;
	}
	@media screen and (max-width: 990px) {
		.d-danquan-xia-20 {
			margin-bottom: 10px;
		}
	}
</style>